﻿// Decompiled with JetBrains decompiler
// Type: Netick.Unity.NetworkSceneOperation
// Assembly: Netick.Unity, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E128C7FD-39ED-4452-86AC-6EC748457030
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.xml

using UnityEngine.SceneManagement;

#nullable disable
namespace Netick.Unity;

public struct NetworkSceneOperation
{
  public ISceneOperation AsyncOperation { get; internal set; }

  public Scene Scene { get; internal set; }

  public bool IsAdditiveScene { get; internal set; }

  public string SceneName { get; internal set; }

  public int BuildIndex { get; internal set; }

  public bool IsLoadOperation { get; internal set; }

  public bool IsUnloadOperation => !this.IsLoadOperation;

  public bool IsValid { get; internal set; }

  public float Progress => this.AsyncOperation != null ? this.AsyncOperation.Progress : 1f;

  public bool IsDone => this.AsyncOperation == null || this.AsyncOperation.IsDone;

  internal NetworkSceneOperation(
    ISceneOperation asyncOperation,
    Scene scene,
    bool isLoadOperation,
    int buildIndex,
    string sceneName,
    bool isAdditive)
  {
    this.AsyncOperation = asyncOperation;
    this.Scene = scene;
    this.IsAdditiveScene = isAdditive;
    this.SceneName = sceneName;
    this.BuildIndex = buildIndex;
    this.IsLoadOperation = isLoadOperation;
    this.IsValid = true;
  }
}
